# -*- Mode: python; py-indent-offset: 4; indent-tabs-mode: nil; coding: utf-8; -*-

# def options(opt):
#     pass

def configure(conf):
    conf.env['ENABLE_COSIM'] = conf.check_nonfatal(header_name='simbricks/proto/network.h')
    conf.report_optional_feature('Cosim', 'Cosim Ethernet Connector',
                                 conf.env['ENABLE_COSIM'],
                                 '<simbricks/proto/network.h> include not detected')
    if not conf.env['ENABLE_COSIM']:
        conf.env['MODULES_NOT_BUILT'].append('cosim')

def build(bld):
    if not bld.env['ENABLE_COSIM']:
        return

    module = bld.create_ns3_module('cosim', ['internet', 'network'])
    module.source = [
        'model/cosim.cc',
        'model/cosim-adapter.cc',
        'model/cosim-adapter-nicif.cc',
        'model/cosim-nicif.cc',
        'helper/cosim-helper.cc',
        ]

    module_test = bld.create_ns3_module_test_library('cosim')
    module_test.source = [
        'test/cosim-test-suite.cc',
        ]

    headers = bld(features='ns3header')
    headers.module = 'cosim'
    headers.source = [
        'model/cosim.h',
        'model/cosim-adapter.h',
        'model/cosim-adapter-nicif.h',
        'model/cosim-nicif.h',
        'helper/cosim-helper.h',
        ]

    if bld.env.ENABLE_EXAMPLES:
        bld.recurse('examples')

    # bld.ns3_python_bindings()

